<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta name="layout" content="main"/>
    <title>Lista Studentów</title>
</head>
<body>
<div class="nav2">
    <span class="menuButton"><g:link class="create" action="create">Dodaj Nowego Studenta</g:link></span>
</div>
<div class="body">
    <h1>Lista Studentów</h1>
    <g:if test="${flash.message}">
        <div class="message">${flash.message}</div>
    </g:if>
    <div class="list">
        <table class="list">
            <thead>
                <tr>

                    <g:sortableColumn property="id" title="Id"/>

                    <g:sortableColumn property="imie" title="Imie"/>

                    <g:sortableColumn property="username" title="Nazwisko"/>

                    <g:sortableColumn property="userRealName" title="Kierunek"/>

                    <g:sortableColumn property="passwd" title="NIP"/>

                    <g:sortableColumn property="enabled" title="PESEL"/>

                    <g:sortableColumn property="id" title="Szczegóły"/>

                </tr>
            </thead>
            <tbody>
                <g:each in="${studentList}" status="i" var="student">
                    <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">

                        <td>${fieldValue(bean: student, field: 'id')}</td>

                        <td>${fieldValue(bean: student, field: 'imie')}</td>

                        <td>${fieldValue(bean: student, field: 'nazwisko')}</td>

                        <td>${fieldValue(bean: student, field: 'kierunekStudiowPodyplomowych')}</td>

                        <td>${fieldValue(bean: student, field: 'NIP')}</td>

                        <td>${fieldValue(bean: student, field: 'PESEL')}</td>

                        <td><g:link action="show" id="${student.id}">Szczegóły..</g:link></td>

                    </tr>
                </g:each>
            </tbody>
        </table>
    </div>
    <div class="paginateButtons">
        <g:paginate total="${Student.count()}"/>
    </div>
</div>
</body>
</html>
